{extend name="public:_base" /}
{block name="css"}
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/uploadify/uploadify.css">
{/block}
{block name="js"}
{include file="public/_validform"}

<script type="text/javascript" src="__STATIC__/admin/hui/lib/ueditor/1.4.3/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__STATIC__/admin/hui/lib/ueditor/1.4.3/ueditor.all.js"></script>
<!--上传配置 -->
<script src="__STATIC__/admin/uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/upfile.js" type="text/javascript"></script>

<script type="text/javascript">
    upload_image('image','','700','400','700');

    var URL = {
        uploader: '{:url('admin/Upload/image')}',
        swf:'__STATIC__/admin/uploadify/uploadify.swf',
        ROOT:'__PUBLIC__/uploads/image',
    }

    var ue = UE.getEditor('editor');
    $("[name='comid']").find("[value='{$data.comid ?? ''}']").attr("selected", true);

    // 遍历option的ID值 传值
    $('.select option').each(function(){
        var opID = $(this).attr('id');
        newopValue(opID);
    });

    // 获得option的ID值 来进行 option的value 来比较
    function newopValue(n){
        $('.select option').each(function(){
            var opValue = $(this).attr('value');
            if(opValue == n) {
                $(this).remove();
            }
        });
    }
</script>
{/block}
{block name="main"}

<div class="user_conver">

    {include file="public:_right"}

    <!-- 文章中心 -->
    <div class="user_item my_data">
        <!-- 标题 -->
        <div class="user_item_title">
            <i class="glyphicon glyphicon-cog"></i>
            发布/编辑 信息 <font>Publish/Edit INFORMATION</font>
        </div>
        <!-- #标题 -->

        <!-- 内容 -->
        <div class="user_item_cont user_info_cont">

            <form class="form form-horizontal" action="#" id="form1" method="post">

                <div class="row cl">
                    <label class="form-label col-xs-2 col-sm-2"><span class="c-red">*</span>单位：</label>
                    <div class="formControls col-xs-10 col-sm-10">

                        <select name="comid" class="select" style="padding: 4px 5px;">
                            {volist name="companyclass" id="vo"}
                            <option value="{$vo.id}">{$vo.title}</option>
                            {/volist}
                        </select>
                    </div>
                </div>

                <div class="row cl">
                    <label class="form-label col-xs-2 col-sm-2"><span class="c-red">*</span>标题：</label>
                    <div class="formControls col-xs-10 col-sm-10">
                        <input type="text" class="input-text" value="{$data.title ?? ''}" placeholder="{:lang('title')}"  datatype="*" name="title">
                    </div>

                </div>
                <div class="row cl">
                    <label class="form-label col-xs-2 col-sm-2">副标题：</label>
                    <div class="formControls col-xs-10 col-sm-10">
                        <input type="text" class="input-text" value="{$data.seo_title ?? ''}" placeholder="副标题"  name="seo_title">
                    </div>
                </div>

                <div class="row cl">
                    <label class="form-label col-xs-2 col-sm-2">关键词：</label>
                    <div class="formControls col-xs-10 col-sm-10">
                        <input type="text" class="input-text" value="{$data.key ?? ''}" placeholder="关键词" name="key">
                    </div>
                </div>

                <div class="row cl">
                    <label class="form-label col-xs-2 col-sm-2">文章作者：</label>
                    <div class="formControls col-xs-10 col-sm-10">
                        <input type="text" class="input-text" value="{$data.issue ?? session('User.name','','User')}" placeholder="文章作者"  name="issue">
                    </div>
                </div>

                <div class="row cl">
                    <label class="form-label col-xs-2 col-sm-2">来源：</label>
                    <div class="formControls col-xs-10 col-sm-10">
                        <input type="text" class="input-text" value="{$wechatkey->source ?? ''}" placeholder="文章来源"  name="source">
                    </div>
                </div>

                <div class="row cl">
                    <label class="form-label col-xs-2 col-sm-2">审稿人：</label>
                    <div class="formControls col-xs-10 col-sm-10">
                        <input type="text" class="input-text" value="{$wechatkey->review ?? ''}" placeholder="审稿人"  name="review">
                    </div>
                </div>

                <div class="row cl">
                    <label class="form-label col-xs-2 col-sm-2"><span class="c-red">*</span>文章描述：</label>
                    <div class="formControls col-xs-10 col-sm-10">
                        <textarea name="miaoshu" cols="" rows="" class="input-text textarea" placeholder="说点什么...最少输入10个字符" dragonfly="true">{$data.miaoshu ?? ''}</textarea>
                    </div>
                </div>

                <div class="row cl">
                    <label class="form-label col-xs-2 col-sm-2">图片700*400 ：</label>
                    <div class="formControls col-xs-10 col-sm-10">
                        <div id="image_s">
                            <img src="__PUBLIC__/uploads/{$data.image ?'image/'.$data.image: 'sm_nopic.jpg'}" width="200px" height="200px"/>
                        </div>
                        <input id="image_post" name="image" type="hidden" value="{$data.image}"/>
                        <input name="old_image" type="hidden" value="{$data.image}"/>
                        <input id="image" name="image_upload" type="file" multiple="true">
                    </div>
                </div>

                <div class="row cl">
                    <label class="form-label col-xs-2 col-sm-2"><span class="c-red">*</span>{:lang('content')}：</label>
                    <div class="formControls col-xs-10 col-sm-10">
                        <script id="editor" type="text/plain" name="center" style="width:100%;height:400px;">{$data.center|default=''|html_entity_decode ?? ''}</script>
                    </div>
                </div>

                <div class="row cl" style="border-bottom: 0;">
                    <div class="col-xs-6 col-sm-6 col-xs-offset-4 col-sm-offset-2">
                        <input name="id" value="{$data.id ?? ''}"  type="hidden" />
                        {:token()}
                        <input class="btn radius btn-primary radius" type="submit" value="&nbsp;&nbsp;{:lang('save')}&nbsp;&nbsp;">
                        <input class="btn radius btn-default radius" type="reset" value="&nbsp;&nbsp;{:lang('cancel')}&nbsp;&nbsp;">
                    </div>
                </div>
            </form>

        </div>
        <!-- #内容 -->
    </div>
    <!-- #文章中心 -->

</div>

{/block}
